function showToast(context,message,delaytime,color)

	-- if (context == nil) or  (message == nil)  or tolua.isnull(context) then
	-- 	return
	-- end
	local curScene = cc.Director:getInstance():getRunningScene()
	delaytime = delaytime or 3
	color = nil
	print("showToast>>>",message)

	local msgtype = type(message)
	if msgtype == "userdata" or msgtype == "table" then
		return
	end

	if message == "" then
		return
	end

	local showMessage = message	
	
	local lab = nil
	local listView = curScene:getChildByName("listView")
	local bg = ccui.ImageView:create("popView/frame_1.png")
	

	lab = cc.Label:createWithTTF(showMessage, "fonts/round_body.ttf", 24)
	lab:setName("toast_lab")
	lab:setOpacity(0)
	bg:setScaleY(0)
	bg:setScale9Enabled(true)
	bg:runAction(cc.Sequence:create(cc.ScaleTo:create(0.2,1,-1.2), cc.ScaleTo:create(0.1,1,-1),cc.CallFunc:create(function()
			lab:setOpacity(255)
			end),
		cc.DelayTime:create(delaytime), 
		cc.Spawn:create(cc.FadeTo:create(0.25,0),cc.CallFunc:create(function()
			lab:runAction(cc.FadeTo:create(0.25,0))
			end)), 
			cc.CallFunc:create(function()
				if listView then
					listView:removeLastItem()
					if #listView:getItems() == 0 then
						listView:removeFromParent()
					end
				end
			end)
		))
	
	local defultBgSize = cc.size(400,bg:getContentSize().height)
	bg:setContentSize(defultBgSize)

	
	lab:setTextColor(not color and cc.c4b(255,255,255,255) or color)
	lab:addTo(bg)

	if nil ~= lab and nil ~= bg then
		lab:setString(showMessage)
		lab:setTextColor(not color and cc.c4b(255,255,255,255) or color)
		local labSize = lab:getContentSize()		

		if labSize.width > defultBgSize.width-10 then
			lab:setHorizontalAlignment(cc.TEXT_ALIGNMENT_CENTER)
			bg:setContentSize(cc.size(labSize.width+30, defultBgSize.height))
		end
		lab:move(bg:getContentSize().width * 0.5, bg:getContentSize().height * 0.5)
	end

	if not listView then
		listView = ccui.ListView:create()
		listView:setAnchorPoint(0.5,0)
		listView:setContentSize(cc.size(display.width,display.height/2+defultBgSize.height))
		listView:setPosition(display.width/2, display.height+defultBgSize.height)
		listView:setDirection(ccui.ScrollViewDir.vertical)
		listView:setGravity(ccui.ListViewGravity.centerHorizontal)
		listView:setBounceEnabled(true)
		listView:setItemsMargin(2)
		listView:setScrollBarEnabled(false)
		listView:setTouchEnabled(false)
		listView:setSwallowTouches(false)
		curScene:addChild(listView,100)
		listView:setName("listView")
		listView:setScaleY(-1)
	
	end
	listView:insertCustomItem(bg,0)

end
function showToast2(context,message,delaytime,color)


	local showMessage = message	
	local tipbg = ccui.ImageView:create("popView/frame_1.png")
	
	tipbg:setAnchorPoint(0.5,0)
	tipbg:setScale9Enabled(true)
	local tipbgSize = tipbg:getContentSize()
	
	local bg_layout = ccui.Layout:create()
	bg_layout:setAnchorPoint(0,0)
	bg_layout:setContentSizei(cc.size(1334,425))
	bg_layout:setPosition(0,325)
	
	
	local lab = nil
	local listView = context:getChildByName("listView")
	local tipbg = ccui.ImageView:create("popView/frame_1.png")

	lab = cc.Label:createWithTTF(showMessage, "fonts/round_body.ttf", 24)
	lab:setName("toast_lab")
	lab:setOpacity(0)
	bg:setScaleY(0)
	bg:setScale9Enabled(true)
	bg:runAction(cc.Sequence:create(cc.ScaleTo:create(0.2,1,-1.2), cc.ScaleTo:create(0.1,1,-1),cc.CallFunc:create(function()
			lab:setOpacity(255)
			end),
		cc.DelayTime:create(delaytime), 
		cc.Spawn:create(cc.FadeTo:create(0.25,0),cc.CallFunc:create(function()
			lab:runAction(cc.FadeTo:create(0.25,0))
			end)), 
			cc.CallFunc:create(function()
				if listView then
					listView:removeLastItem()
					if #listView:getItems() == 0 then
						listView:removeFromParent()
					end
				end
			end)
		))
	
	local defultBgSize = cc.size(400,bg:getContentSize().height)
	bg:setContentSize(defultBgSize)

	
	lab:setTextColor(not color and cc.c4b(255,255,255,255) or color)
	lab:addTo(bg)

	if nil ~= lab and nil ~= bg then
		lab:setString(showMessage)
		lab:setTextColor(not color and cc.c4b(255,255,255,255) or color)
		local labSize = lab:getContentSize()		

		if labSize.width > defultBgSize.width-10 then
			lab:setHorizontalAlignment(cc.TEXT_ALIGNMENT_CENTER)
			bg:setContentSize(cc.size(labSize.width+30, defultBgSize.height))
		end
		lab:move(bg:getContentSize().width * 0.5, bg:getContentSize().height * 0.5)
	end

	if not listView then
		listView = ccui.ListView:create()
		listView:setAnchorPoint(0.5,0)
		listView:setContentSize(cc.size(display.width,display.height/2+defultBgSize.height))
		listView:setPosition(display.width/2, display.height+defultBgSize.height)
		listView:setDirection(ccui.ScrollViewDir.vertical)
		listView:setGravity(ccui.ListViewGravity.centerHorizontal)
		listView:setBounceEnabled(true)
		listView:setItemsMargin(2)
		listView:setScrollBarEnabled(false)
		listView:setTouchEnabled(false)
		listView:setSwallowTouches(false)
		context:addChild(listView,100)
		listView:setName("listView")
		listView:setScaleY(-1)
	
	end
	listView:insertCustomItem(bg,0)

end
--不渐变形式toast(fadeto方法，在安卓调用的时候会导致底图不显示)
function showToastNoFade(context,message,delaytime,color)
	if (context == nil) or  (message == nil) or (delaytime<1) then
		return
	end

	local msgtype = type(message)
	if msgtype == "userdata" or msgtype == "table" then
		return
	end

	if message == "" then
		return
	end
	local showMessage = message	
	
	local bg = context:getChildByName("toast_bg")
	local lab = nil
	if bg then
		bg:stopAllActions()
		lab = bg:getChildByName("toast_lab")
	else
		bg = ccui.ImageView:create("General/frame_1.png")
		bg:move(appdf.WIDTH/2,appdf.HEIGHT/2)
		bg:addTo(context)
		bg:setName("toast_bg")
		bg:setScale9Enabled(true)		

		lab = cc.Label:createWithTTF(showMessage, "fonts/round_body.ttf", 24, cc.size(930,0))
		lab:setName("toast_lab")
		
		lab:setTextColor(not color and cc.c4b(255,255,255,255) or color)
		lab:addTo(bg)
	end

	if nil ~= lab and nil ~= bg then
		lab:setString(showMessage)
		lab:setTextColor(not color and cc.c4b(255,255,255,255) or color)
		bg:runAction(cc.Sequence:create(cc.DelayTime:create(delaytime), cc.RemoveSelf:create(true)))

		local labSize = lab:getContentSize()
		if labSize.height < 30 then
			lab:setHorizontalAlignment(cc.TEXT_ALIGNMENT_CENTER)
			bg:setContentSize(cc.size(appdf.WIDTH, 64))
		else
			lab:setHorizontalAlignment(cc.TEXT_ALIGNMENT_LEFT)
			bg:setContentSize(cc.size(appdf.WIDTH, 64 + labSize.height))		
		end
		lab:move(appdf.WIDTH * 0.5, bg:getContentSize().height * 0.5)
	end
end